/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.toools.gwt.wmc.client.waste;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.ServiceDefTarget;
import java.util.Collection;
import org.toools.gwt.wmc.jpa.Waste;

/**
 *
 * @author Manuel
 */
public interface WasteService extends RemoteService {

    public static class Util {
		private static WasteServiceAsync instance;
		public static WasteServiceAsync getInstance(){
			if (instance == null) {
				instance = (WasteServiceAsync) GWT.create(WasteService.class);
				ServiceDefTarget target = (ServiceDefTarget) instance;
				target.setServiceEntryPoint(GWT.getHostPageBaseURL() + "WMC/WasteService");
			}
			return instance;
		}
	}

    Waste getWasteByID( Integer id );
    Collection<Waste> getWastes();

    Waste create( Waste w );
    Boolean delete( Waste w );
    Boolean update( Waste w );
}
